﻿using System;
using System.Data;
using Model;
using DBUtility;

namespace DAL
{
     /// <summary>
     /// 数据访问层RESULT_TAXI_MILEAGE_DAL
     /// </summary>
     public class RESULT_TAXI_MILEAGE_DAL
     {
         public RESULT_TAXI_MILEAGE_DAL()
         {
         }


         /// <summary>
         /// 得到最大JCLSH
         /// </summary>
         public string GetMax_JCLSH(string p_strWhere)
         {
             string strResult = "0";
             string strSql = "select max(JCLSH) as m from RESULT_TAXI_MILEAGE";

             if(p_strWhere.Trim().Length > 0)
             {
                 strSql += " where " + p_strWhere;
             }

             DataTable dtTemp = new DataTable();
             DbHelper.GetTable(strSql, ref dtTemp);

             if(dtTemp.Rows.Count>0)
             {
                 if(dtTemp.Rows[0]["m"].ToString().Length>0)
                 {
                     strResult = dtTemp.Rows[0]["m"] == DBNull.Value ? "" : dtTemp.Rows[0]["m"].ToString();
                 }
             }

             dtTemp.Dispose();

             return string.Format("{0:D50}", Convert.ToInt32(strResult) + 1);

          }

          /// <summary>
          /// 得到最大JCLSH
          /// </summary>
          public string GetMax_JCLSH()
          {
              return GetMax_JCLSH("");
          }


          /// <summary>
          /// 判断数据是否存在
          /// </summary>
          public bool Exists(string strJCLSH)
          {
               bool bolResult = false;

               if (strJCLSH == null)
               {
                   return false;
               }

               if (strJCLSH.Length == 0)
               {
                   return false;
               }

               string strSql = "";
               strSql += "select count(1) as c from RESULT_TAXI_MILEAGE";
               strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

               DataTable dtTemp = new DataTable();
               DbHelper.GetTable(strSql, ref dtTemp);

               if (dtTemp.Rows.Count > 0)
               {
                   bolResult = Convert.ToInt32(dtTemp.Rows[0]["c"]) > 0;
               }

               dtTemp.Dispose();

               return bolResult;

          }

          /// <summary>
          /// 获取数据总记录数
          /// </summary>
          public int GetRecordCount(string p_strWhere)
          {
              int intResult=0;

              string strSql = "";
              strSql += "select count(1) as c from RESULT_TAXI_MILEAGE";
              if(p_strWhere.Trim().Length > 0)
              {
                 strSql += " where " + p_strWhere;
              }

              DataTable dtTemp = new DataTable();
              DbHelper.GetTable(strSql, ref dtTemp);

              if(dtTemp.Rows.Count>0)
              {
                  intResult=Convert.ToInt32(dtTemp.Rows[0]["c"]);
              }

              dtTemp.Dispose();

              return intResult;
          }

          /// <summary>
          /// 获取数据总记录数
          /// </summary>
          public int GetRecordCount()
          {
              return GetRecordCount("");
          }

          /// <summary>
          /// 获取数据分页总数
           /// </summary>
          public int GetPageCount(string p_strWhere, int p_intPageSize)
          {
              int intResult=0;

              if(p_intPageSize > 0)
              {
                  int intRecordCount = GetRecordCount(p_strWhere);
                  intResult = Convert.ToInt32(Math.Truncate(Convert.ToDecimal(intRecordCount) / Convert.ToDecimal(p_intPageSize)));
                  if (intRecordCount > (intResult * p_intPageSize))
                  {
                       intResult++;
                  }
              }

              if(intResult == 0)
              {
                   intResult++;
              }
              return intResult;
           }

          /// <summary>
          /// 获取数据分页总数
          /// </summary>
          public int GetPageCount(int p_intPageSize)
          {
              return GetPageCount("", p_intPageSize);
          }

          /// <summary>
          /// 添加一条数据 SQL
          /// </summary>
          public string InsertSQL(RESULT_TAXI_MILEAGE model)
          {
              string strFieldSQL = "";
              string strValueSQL = "";

              if(model.Changed("ID") == true)
              {
                   strFieldSQL += ",ID";
                   strValueSQL += "," + model.ID + "";
              }

              if(model.Changed("LCBJCCS") == true)
              {
                   strFieldSQL += ",LCBJCCS";
                   strValueSQL += ",'" + model.LCBJCCS.Replace("'","''") + "'";
              }

              if(model.Changed("JCLSH") == true)
              {
                   strFieldSQL += ",JCLSH";
                   strValueSQL += ",'" + model.JCLSH.Replace("'","''") + "'";
              }

              if(model.Changed("LCB_PD") == true)
              {
                   strFieldSQL += ",LCB_PD";
                   strValueSQL += ",'" + model.LCB_PD.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC1") == true)
              {
                   strFieldSQL += ",SCLC1";
                   strValueSQL += ",'" + model.SCLC1.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC2") == true)
              {
                   strFieldSQL += ",SCLC2";
                   strValueSQL += ",'" + model.SCLC2.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC3") == true)
              {
                   strFieldSQL += ",SCLC3";
                   strValueSQL += ",'" + model.SCLC3.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC4") == true)
              {
                   strFieldSQL += ",SCLC4";
                   strValueSQL += ",'" + model.SCLC4.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC5") == true)
              {
                   strFieldSQL += ",SCLC5";
                   strValueSQL += ",'" + model.SCLC5.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC6") == true)
              {
                   strFieldSQL += ",SCLC6";
                   strValueSQL += ",'" + model.SCLC6.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC1") == true)
              {
                   strFieldSQL += ",MBLC1";
                   strValueSQL += ",'" + model.MBLC1.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC2") == true)
              {
                   strFieldSQL += ",MBLC2";
                   strValueSQL += ",'" + model.MBLC2.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC3") == true)
              {
                   strFieldSQL += ",MBLC3";
                   strValueSQL += ",'" + model.MBLC3.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC4") == true)
              {
                   strFieldSQL += ",MBLC4";
                   strValueSQL += ",'" + model.MBLC4.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC5") == true)
              {
                   strFieldSQL += ",MBLC5";
                   strValueSQL += ",'" + model.MBLC5.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC6") == true)
              {
                   strFieldSQL += ",MBLC6";
                   strValueSQL += ",'" + model.MBLC6.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC1") == true)
              {
                   strFieldSQL += ",JDWC1";
                   strValueSQL += ",'" + model.JDWC1.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC2") == true)
              {
                   strFieldSQL += ",JDWC2";
                   strValueSQL += ",'" + model.JDWC2.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC3") == true)
              {
                   strFieldSQL += ",JDWC3";
                   strValueSQL += ",'" + model.JDWC3.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC4") == true)
              {
                   strFieldSQL += ",JDWC4";
                   strValueSQL += ",'" + model.JDWC4.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC5") == true)
              {
                   strFieldSQL += ",JDWC5";
                   strValueSQL += ",'" + model.JDWC5.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC6") == true)
              {
                   strFieldSQL += ",JDWC6";
                   strValueSQL += ",'" + model.JDWC6.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC1") == true)
              {
                   strFieldSQL += ",XDWC1";
                   strValueSQL += ",'" + model.XDWC1.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC2") == true)
              {
                   strFieldSQL += ",XDWC2";
                   strValueSQL += ",'" + model.XDWC2.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC3") == true)
              {
                   strFieldSQL += ",XDWC3";
                   strValueSQL += ",'" + model.XDWC3.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC4") == true)
              {
                   strFieldSQL += ",XDWC4";
                   strValueSQL += ",'" + model.XDWC4.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC5") == true)
              {
                   strFieldSQL += ",XDWC5";
                   strValueSQL += ",'" + model.XDWC5.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC6") == true)
              {
                   strFieldSQL += ",XDWC6";
                   strValueSQL += ",'" + model.XDWC6.Replace("'","''") + "'";
              }

              if(model.Changed("LC1_PD") == true)
              {
                   strFieldSQL += ",LC1_PD";
                   strValueSQL += ",'" + model.LC1_PD.Replace("'","''") + "'";
              }

              if(model.Changed("LC2_PD") == true)
              {
                   strFieldSQL += ",LC2_PD";
                   strValueSQL += ",'" + model.LC2_PD.Replace("'","''") + "'";
              }

              if(model.Changed("LC3_PD") == true)
              {
                   strFieldSQL += ",LC3_PD";
                   strValueSQL += ",'" + model.LC3_PD.Replace("'","''") + "'";
              }

              if(model.Changed("LC4_PD") == true)
              {
                   strFieldSQL += ",LC4_PD";
                   strValueSQL += ",'" + model.LC4_PD.Replace("'","''") + "'";
              }

              if(model.Changed("LC5_PD") == true)
              {
                   strFieldSQL += ",LC5_PD";
                   strValueSQL += ",'" + model.LC5_PD.Replace("'","''") + "'";
              }

              if(model.Changed("LC6_PD") == true)
              {
                   strFieldSQL += ",LC6_PD";
                   strValueSQL += ",'" + model.LC6_PD.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDZSJ") == true)
              {
                   strFieldSQL += ",TCDDZSJ";
                   strValueSQL += ",'" + model.TCDDZSJ.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDJSSJ") == true)
              {
                   strFieldSQL += ",TCDDJSSJ";
                   strValueSQL += ",'" + model.TCDDJSSJ.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDZSJBZ") == true)
              {
                   strFieldSQL += ",TCDDZSJBZ";
                   strValueSQL += ",'" + model.TCDDZSJBZ.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDJSSJBZ") == true)
              {
                   strFieldSQL += ",TCDDJSSJBZ";
                   strValueSQL += ",'" + model.TCDDJSSJBZ.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDZSJJDWC") == true)
              {
                   strFieldSQL += ",TCDDZSJJDWC";
                   strValueSQL += ",'" + model.TCDDZSJJDWC.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDJSSJJDWC") == true)
              {
                   strFieldSQL += ",TCDDJSSJJDWC";
                   strValueSQL += ",'" + model.TCDDJSSJJDWC.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDZSJXDWC") == true)
              {
                   strFieldSQL += ",TCDDZSJXDWC";
                   strValueSQL += ",'" + model.TCDDZSJXDWC.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDJSSJXDWC") == true)
              {
                   strFieldSQL += ",TCDDJSSJXDWC";
                   strValueSQL += ",'" + model.TCDDJSSJXDWC.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDZSJ_PD") == true)
              {
                   strFieldSQL += ",TCDDZSJ_PD";
                   strValueSQL += ",'" + model.TCDDZSJ_PD.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDJSSJ_PD") == true)
              {
                   strFieldSQL += ",TCDDJSSJ_PD";
                   strValueSQL += ",'" + model.TCDDJSSJ_PD.Replace("'","''") + "'";
              }

              if(model.Changed("IsByHandle") == true)
              {
                   strFieldSQL += ",IsByHandle";
                   strValueSQL += "," + model.IsByHandle + "";
              }

              string strSql = "";
              strSql += "insert into RESULT_TAXI_MILEAGE";
              strSql += "(";
              strSql += strFieldSQL.Substring(1);
              strSql += ")";
              strSql += " values";
              strSql += "(";
              strSql += strValueSQL.Substring(1);
              strSql += ")";

              return strSql;
          }

          /// <summary>
          /// 添加一条数据
          /// </summary>
          public bool Insert(RESULT_TAXI_MILEAGE model)
          {
              return DbHelper.ExecuteSql(InsertSQL(model));
          }

          /// <summary>
          /// 修改一条数据 SQL
          /// </summary>
          public string UpdateSQL(RESULT_TAXI_MILEAGE model,string strJCLSH)
          {
              string strUpdateSQL = "";

              if(model.Changed("ID") == true)
              {
                  strUpdateSQL += ",ID=" + model.ID + "";
              }

              if(model.Changed("LCBJCCS") == true)
              {
                  strUpdateSQL += ",LCBJCCS='" + model.LCBJCCS.Replace("'","''") + "'";
              }

              if(model.Changed("JCLSH") == true)
              {
                  strUpdateSQL += ",JCLSH='" + model.JCLSH.Replace("'","''") + "'";
              }

              if(model.Changed("LCB_PD") == true)
              {
                  strUpdateSQL += ",LCB_PD='" + model.LCB_PD.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC1") == true)
              {
                  strUpdateSQL += ",SCLC1='" + model.SCLC1.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC2") == true)
              {
                  strUpdateSQL += ",SCLC2='" + model.SCLC2.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC3") == true)
              {
                  strUpdateSQL += ",SCLC3='" + model.SCLC3.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC4") == true)
              {
                  strUpdateSQL += ",SCLC4='" + model.SCLC4.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC5") == true)
              {
                  strUpdateSQL += ",SCLC5='" + model.SCLC5.Replace("'","''") + "'";
              }

              if(model.Changed("SCLC6") == true)
              {
                  strUpdateSQL += ",SCLC6='" + model.SCLC6.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC1") == true)
              {
                  strUpdateSQL += ",MBLC1='" + model.MBLC1.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC2") == true)
              {
                  strUpdateSQL += ",MBLC2='" + model.MBLC2.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC3") == true)
              {
                  strUpdateSQL += ",MBLC3='" + model.MBLC3.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC4") == true)
              {
                  strUpdateSQL += ",MBLC4='" + model.MBLC4.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC5") == true)
              {
                  strUpdateSQL += ",MBLC5='" + model.MBLC5.Replace("'","''") + "'";
              }

              if(model.Changed("MBLC6") == true)
              {
                  strUpdateSQL += ",MBLC6='" + model.MBLC6.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC1") == true)
              {
                  strUpdateSQL += ",JDWC1='" + model.JDWC1.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC2") == true)
              {
                  strUpdateSQL += ",JDWC2='" + model.JDWC2.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC3") == true)
              {
                  strUpdateSQL += ",JDWC3='" + model.JDWC3.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC4") == true)
              {
                  strUpdateSQL += ",JDWC4='" + model.JDWC4.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC5") == true)
              {
                  strUpdateSQL += ",JDWC5='" + model.JDWC5.Replace("'","''") + "'";
              }

              if(model.Changed("JDWC6") == true)
              {
                  strUpdateSQL += ",JDWC6='" + model.JDWC6.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC1") == true)
              {
                  strUpdateSQL += ",XDWC1='" + model.XDWC1.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC2") == true)
              {
                  strUpdateSQL += ",XDWC2='" + model.XDWC2.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC3") == true)
              {
                  strUpdateSQL += ",XDWC3='" + model.XDWC3.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC4") == true)
              {
                  strUpdateSQL += ",XDWC4='" + model.XDWC4.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC5") == true)
              {
                  strUpdateSQL += ",XDWC5='" + model.XDWC5.Replace("'","''") + "'";
              }

              if(model.Changed("XDWC6") == true)
              {
                  strUpdateSQL += ",XDWC6='" + model.XDWC6.Replace("'","''") + "'";
              }

              if(model.Changed("LC1_PD") == true)
              {
                  strUpdateSQL += ",LC1_PD='" + model.LC1_PD.Replace("'","''") + "'";
              }

              if(model.Changed("LC2_PD") == true)
              {
                  strUpdateSQL += ",LC2_PD='" + model.LC2_PD.Replace("'","''") + "'";
              }

              if(model.Changed("LC3_PD") == true)
              {
                  strUpdateSQL += ",LC3_PD='" + model.LC3_PD.Replace("'","''") + "'";
              }

              if(model.Changed("LC4_PD") == true)
              {
                  strUpdateSQL += ",LC4_PD='" + model.LC4_PD.Replace("'","''") + "'";
              }

              if(model.Changed("LC5_PD") == true)
              {
                  strUpdateSQL += ",LC5_PD='" + model.LC5_PD.Replace("'","''") + "'";
              }

              if(model.Changed("LC6_PD") == true)
              {
                  strUpdateSQL += ",LC6_PD='" + model.LC6_PD.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDZSJ") == true)
              {
                  strUpdateSQL += ",TCDDZSJ='" + model.TCDDZSJ.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDJSSJ") == true)
              {
                  strUpdateSQL += ",TCDDJSSJ='" + model.TCDDJSSJ.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDZSJBZ") == true)
              {
                  strUpdateSQL += ",TCDDZSJBZ='" + model.TCDDZSJBZ.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDJSSJBZ") == true)
              {
                  strUpdateSQL += ",TCDDJSSJBZ='" + model.TCDDJSSJBZ.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDZSJJDWC") == true)
              {
                  strUpdateSQL += ",TCDDZSJJDWC='" + model.TCDDZSJJDWC.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDJSSJJDWC") == true)
              {
                  strUpdateSQL += ",TCDDJSSJJDWC='" + model.TCDDJSSJJDWC.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDZSJXDWC") == true)
              {
                  strUpdateSQL += ",TCDDZSJXDWC='" + model.TCDDZSJXDWC.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDJSSJXDWC") == true)
              {
                  strUpdateSQL += ",TCDDJSSJXDWC='" + model.TCDDJSSJXDWC.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDZSJ_PD") == true)
              {
                  strUpdateSQL += ",TCDDZSJ_PD='" + model.TCDDZSJ_PD.Replace("'","''") + "'";
              }

              if(model.Changed("TCDDJSSJ_PD") == true)
              {
                  strUpdateSQL += ",TCDDJSSJ_PD='" + model.TCDDJSSJ_PD.Replace("'","''") + "'";
              }

              if(model.Changed("IsByHandle") == true)
              {
                  strUpdateSQL += ",IsByHandle=" + model.IsByHandle + "";
              }

               string strSql = "";
               strSql += "update RESULT_TAXI_MILEAGE set ";
               strSql += strUpdateSQL.Substring(1);
               strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

               return strSql;
          }

          /// <summary>
          /// 修改一条数据
          /// </summary>
          public bool Update(RESULT_TAXI_MILEAGE model, string strJCLSH)
          {
              return DbHelper.ExecuteSql(UpdateSQL(model, strJCLSH));
          }

          /// <summary>
          /// 修改一个集合 SQL
          /// </summary>
           public string UpdateRangeSQL(RESULT_TAXI_MILEAGE model, string p_strWhere)
          {
               string strUpdateSQL = "";

               if(model.Changed("ID") == true)
               {
                  strUpdateSQL += ",ID=" + model.ID + "";
               }

               if(model.Changed("LCBJCCS") == true)
               {
                  strUpdateSQL += ",LCBJCCS='" + model.LCBJCCS.Replace("'","''") + "'";
               }

               if(model.Changed("JCLSH") == true)
               {
                  strUpdateSQL += ",JCLSH='" + model.JCLSH.Replace("'","''") + "'";
               }

               if(model.Changed("LCB_PD") == true)
               {
                  strUpdateSQL += ",LCB_PD='" + model.LCB_PD.Replace("'","''") + "'";
               }

               if(model.Changed("SCLC1") == true)
               {
                  strUpdateSQL += ",SCLC1='" + model.SCLC1.Replace("'","''") + "'";
               }

               if(model.Changed("SCLC2") == true)
               {
                  strUpdateSQL += ",SCLC2='" + model.SCLC2.Replace("'","''") + "'";
               }

               if(model.Changed("SCLC3") == true)
               {
                  strUpdateSQL += ",SCLC3='" + model.SCLC3.Replace("'","''") + "'";
               }

               if(model.Changed("SCLC4") == true)
               {
                  strUpdateSQL += ",SCLC4='" + model.SCLC4.Replace("'","''") + "'";
               }

               if(model.Changed("SCLC5") == true)
               {
                  strUpdateSQL += ",SCLC5='" + model.SCLC5.Replace("'","''") + "'";
               }

               if(model.Changed("SCLC6") == true)
               {
                  strUpdateSQL += ",SCLC6='" + model.SCLC6.Replace("'","''") + "'";
               }

               if(model.Changed("MBLC1") == true)
               {
                  strUpdateSQL += ",MBLC1='" + model.MBLC1.Replace("'","''") + "'";
               }

               if(model.Changed("MBLC2") == true)
               {
                  strUpdateSQL += ",MBLC2='" + model.MBLC2.Replace("'","''") + "'";
               }

               if(model.Changed("MBLC3") == true)
               {
                  strUpdateSQL += ",MBLC3='" + model.MBLC3.Replace("'","''") + "'";
               }

               if(model.Changed("MBLC4") == true)
               {
                  strUpdateSQL += ",MBLC4='" + model.MBLC4.Replace("'","''") + "'";
               }

               if(model.Changed("MBLC5") == true)
               {
                  strUpdateSQL += ",MBLC5='" + model.MBLC5.Replace("'","''") + "'";
               }

               if(model.Changed("MBLC6") == true)
               {
                  strUpdateSQL += ",MBLC6='" + model.MBLC6.Replace("'","''") + "'";
               }

               if(model.Changed("JDWC1") == true)
               {
                  strUpdateSQL += ",JDWC1='" + model.JDWC1.Replace("'","''") + "'";
               }

               if(model.Changed("JDWC2") == true)
               {
                  strUpdateSQL += ",JDWC2='" + model.JDWC2.Replace("'","''") + "'";
               }

               if(model.Changed("JDWC3") == true)
               {
                  strUpdateSQL += ",JDWC3='" + model.JDWC3.Replace("'","''") + "'";
               }

               if(model.Changed("JDWC4") == true)
               {
                  strUpdateSQL += ",JDWC4='" + model.JDWC4.Replace("'","''") + "'";
               }

               if(model.Changed("JDWC5") == true)
               {
                  strUpdateSQL += ",JDWC5='" + model.JDWC5.Replace("'","''") + "'";
               }

               if(model.Changed("JDWC6") == true)
               {
                  strUpdateSQL += ",JDWC6='" + model.JDWC6.Replace("'","''") + "'";
               }

               if(model.Changed("XDWC1") == true)
               {
                  strUpdateSQL += ",XDWC1='" + model.XDWC1.Replace("'","''") + "'";
               }

               if(model.Changed("XDWC2") == true)
               {
                  strUpdateSQL += ",XDWC2='" + model.XDWC2.Replace("'","''") + "'";
               }

               if(model.Changed("XDWC3") == true)
               {
                  strUpdateSQL += ",XDWC3='" + model.XDWC3.Replace("'","''") + "'";
               }

               if(model.Changed("XDWC4") == true)
               {
                  strUpdateSQL += ",XDWC4='" + model.XDWC4.Replace("'","''") + "'";
               }

               if(model.Changed("XDWC5") == true)
               {
                  strUpdateSQL += ",XDWC5='" + model.XDWC5.Replace("'","''") + "'";
               }

               if(model.Changed("XDWC6") == true)
               {
                  strUpdateSQL += ",XDWC6='" + model.XDWC6.Replace("'","''") + "'";
               }

               if(model.Changed("LC1_PD") == true)
               {
                  strUpdateSQL += ",LC1_PD='" + model.LC1_PD.Replace("'","''") + "'";
               }

               if(model.Changed("LC2_PD") == true)
               {
                  strUpdateSQL += ",LC2_PD='" + model.LC2_PD.Replace("'","''") + "'";
               }

               if(model.Changed("LC3_PD") == true)
               {
                  strUpdateSQL += ",LC3_PD='" + model.LC3_PD.Replace("'","''") + "'";
               }

               if(model.Changed("LC4_PD") == true)
               {
                  strUpdateSQL += ",LC4_PD='" + model.LC4_PD.Replace("'","''") + "'";
               }

               if(model.Changed("LC5_PD") == true)
               {
                  strUpdateSQL += ",LC5_PD='" + model.LC5_PD.Replace("'","''") + "'";
               }

               if(model.Changed("LC6_PD") == true)
               {
                  strUpdateSQL += ",LC6_PD='" + model.LC6_PD.Replace("'","''") + "'";
               }

               if(model.Changed("TCDDZSJ") == true)
               {
                  strUpdateSQL += ",TCDDZSJ='" + model.TCDDZSJ.Replace("'","''") + "'";
               }

               if(model.Changed("TCDDJSSJ") == true)
               {
                  strUpdateSQL += ",TCDDJSSJ='" + model.TCDDJSSJ.Replace("'","''") + "'";
               }

               if(model.Changed("TCDDZSJBZ") == true)
               {
                  strUpdateSQL += ",TCDDZSJBZ='" + model.TCDDZSJBZ.Replace("'","''") + "'";
               }

               if(model.Changed("TCDDJSSJBZ") == true)
               {
                  strUpdateSQL += ",TCDDJSSJBZ='" + model.TCDDJSSJBZ.Replace("'","''") + "'";
               }

               if(model.Changed("TCDDZSJJDWC") == true)
               {
                  strUpdateSQL += ",TCDDZSJJDWC='" + model.TCDDZSJJDWC.Replace("'","''") + "'";
               }

               if(model.Changed("TCDDJSSJJDWC") == true)
               {
                  strUpdateSQL += ",TCDDJSSJJDWC='" + model.TCDDJSSJJDWC.Replace("'","''") + "'";
               }

               if(model.Changed("TCDDZSJXDWC") == true)
               {
                  strUpdateSQL += ",TCDDZSJXDWC='" + model.TCDDZSJXDWC.Replace("'","''") + "'";
               }

               if(model.Changed("TCDDJSSJXDWC") == true)
               {
                  strUpdateSQL += ",TCDDJSSJXDWC='" + model.TCDDJSSJXDWC.Replace("'","''") + "'";
               }

               if(model.Changed("TCDDZSJ_PD") == true)
               {
                  strUpdateSQL += ",TCDDZSJ_PD='" + model.TCDDZSJ_PD.Replace("'","''") + "'";
               }

               if(model.Changed("TCDDJSSJ_PD") == true)
               {
                  strUpdateSQL += ",TCDDJSSJ_PD='" + model.TCDDJSSJ_PD.Replace("'","''") + "'";
               }

               if(model.Changed("IsByHandle") == true)
               {
                  strUpdateSQL += ",IsByHandle=" + model.IsByHandle + "";
               }

              string strSql = "";
              strSql += "update RESULT_TAXI_MILEAGE set ";
              strSql += strUpdateSQL.Substring(1);
              strSql += " where " + p_strWhere;

              return strSql;
          }

          /// <summary>
          /// 修改一个集合
          /// </summary>
          public bool UpdateRange(RESULT_TAXI_MILEAGE model, string p_strWhere)
          {
              return DbHelper.ExecuteSql(UpdateRangeSQL(model, p_strWhere));
          }

          /// <summary>
          /// 修改全部数据 SQL
          /// </summary>
          public string UpdateAllSQL(RESULT_TAXI_MILEAGE model)
          {
              string strUpdateSQL = "";

                  strUpdateSQL += ",ID=" + model.ID + "";
                  strUpdateSQL += ",LCBJCCS='" + model.LCBJCCS.Replace("'","''") + "'";
                  strUpdateSQL += ",JCLSH='" + model.JCLSH.Replace("'","''") + "'";
                  strUpdateSQL += ",LCB_PD='" + model.LCB_PD.Replace("'","''") + "'";
                  strUpdateSQL += ",SCLC1='" + model.SCLC1.Replace("'","''") + "'";
                  strUpdateSQL += ",SCLC2='" + model.SCLC2.Replace("'","''") + "'";
                  strUpdateSQL += ",SCLC3='" + model.SCLC3.Replace("'","''") + "'";
                  strUpdateSQL += ",SCLC4='" + model.SCLC4.Replace("'","''") + "'";
                  strUpdateSQL += ",SCLC5='" + model.SCLC5.Replace("'","''") + "'";
                  strUpdateSQL += ",SCLC6='" + model.SCLC6.Replace("'","''") + "'";
                  strUpdateSQL += ",MBLC1='" + model.MBLC1.Replace("'","''") + "'";
                  strUpdateSQL += ",MBLC2='" + model.MBLC2.Replace("'","''") + "'";
                  strUpdateSQL += ",MBLC3='" + model.MBLC3.Replace("'","''") + "'";
                  strUpdateSQL += ",MBLC4='" + model.MBLC4.Replace("'","''") + "'";
                  strUpdateSQL += ",MBLC5='" + model.MBLC5.Replace("'","''") + "'";
                  strUpdateSQL += ",MBLC6='" + model.MBLC6.Replace("'","''") + "'";
                  strUpdateSQL += ",JDWC1='" + model.JDWC1.Replace("'","''") + "'";
                  strUpdateSQL += ",JDWC2='" + model.JDWC2.Replace("'","''") + "'";
                  strUpdateSQL += ",JDWC3='" + model.JDWC3.Replace("'","''") + "'";
                  strUpdateSQL += ",JDWC4='" + model.JDWC4.Replace("'","''") + "'";
                  strUpdateSQL += ",JDWC5='" + model.JDWC5.Replace("'","''") + "'";
                  strUpdateSQL += ",JDWC6='" + model.JDWC6.Replace("'","''") + "'";
                  strUpdateSQL += ",XDWC1='" + model.XDWC1.Replace("'","''") + "'";
                  strUpdateSQL += ",XDWC2='" + model.XDWC2.Replace("'","''") + "'";
                  strUpdateSQL += ",XDWC3='" + model.XDWC3.Replace("'","''") + "'";
                  strUpdateSQL += ",XDWC4='" + model.XDWC4.Replace("'","''") + "'";
                  strUpdateSQL += ",XDWC5='" + model.XDWC5.Replace("'","''") + "'";
                  strUpdateSQL += ",XDWC6='" + model.XDWC6.Replace("'","''") + "'";
                  strUpdateSQL += ",LC1_PD='" + model.LC1_PD.Replace("'","''") + "'";
                  strUpdateSQL += ",LC2_PD='" + model.LC2_PD.Replace("'","''") + "'";
                  strUpdateSQL += ",LC3_PD='" + model.LC3_PD.Replace("'","''") + "'";
                  strUpdateSQL += ",LC4_PD='" + model.LC4_PD.Replace("'","''") + "'";
                  strUpdateSQL += ",LC5_PD='" + model.LC5_PD.Replace("'","''") + "'";
                  strUpdateSQL += ",LC6_PD='" + model.LC6_PD.Replace("'","''") + "'";
                  strUpdateSQL += ",TCDDZSJ='" + model.TCDDZSJ.Replace("'","''") + "'";
                  strUpdateSQL += ",TCDDJSSJ='" + model.TCDDJSSJ.Replace("'","''") + "'";
                  strUpdateSQL += ",TCDDZSJBZ='" + model.TCDDZSJBZ.Replace("'","''") + "'";
                  strUpdateSQL += ",TCDDJSSJBZ='" + model.TCDDJSSJBZ.Replace("'","''") + "'";
                  strUpdateSQL += ",TCDDZSJJDWC='" + model.TCDDZSJJDWC.Replace("'","''") + "'";
                  strUpdateSQL += ",TCDDJSSJJDWC='" + model.TCDDJSSJJDWC.Replace("'","''") + "'";
                  strUpdateSQL += ",TCDDZSJXDWC='" + model.TCDDZSJXDWC.Replace("'","''") + "'";
                  strUpdateSQL += ",TCDDJSSJXDWC='" + model.TCDDJSSJXDWC.Replace("'","''") + "'";
                  strUpdateSQL += ",TCDDZSJ_PD='" + model.TCDDZSJ_PD.Replace("'","''") + "'";
                  strUpdateSQL += ",TCDDJSSJ_PD='" + model.TCDDJSSJ_PD.Replace("'","''") + "'";
                  strUpdateSQL += ",IsByHandle=" + model.IsByHandle + "";


               string strSql = "";
               strSql += "update RESULT_TAXI_MILEAGE set ";
               strSql += strUpdateSQL.Substring(1);

               return strSql;

          }

          /// <summary>
          /// 修改全部数据
          /// </summary>
          public bool UpdateAll(RESULT_TAXI_MILEAGE model)
          {
              return DbHelper.ExecuteSql(UpdateAllSQL(model));
          }

          /// <summary>
          /// 删除一条数据 SQL
          /// </summary>
          public string DeleteSQL(string strJCLSH)
          {
              string strSql = "";
              strSql += "delete from RESULT_TAXI_MILEAGE";
              strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

              return strSql;

          }

          /// <summary>
          /// 删除一条数据
          /// </summary>
          public bool Delete(string strJCLSH)
          {
              return DbHelper.ExecuteSql(DeleteSQL(strJCLSH));
          }

          /// <summary>
          /// 删除一个集合 SQL
          /// </summary>
          public string DeleteRangeSQL(string p_strWhere)
          {
              string strSql = "";
              strSql += "delete from RESULT_TAXI_MILEAGE";
              strSql += " where " + p_strWhere;

              return strSql;
           }

          /// <summary>
          /// 删除一个集合
          /// </summary>
          public bool DeleteRange(string p_strWhere)
          {
              return DbHelper.ExecuteSql(DeleteRangeSQL(p_strWhere));
          }

          /// <summary>
          /// 删除全部 SQL
          /// </summary>
          public string DeleteAllSQL()
          {
              string strSql = "";
              strSql += "delete from RESULT_TAXI_MILEAGE";

              return strSql;
           }

         /// <summary>
         /// 删除全部
         /// </summary>
         public bool DeleteAll()
         {
             return DbHelper.ExecuteSql(DeleteAllSQL());
         }

          /// <summary>
         /// 得到一个对象实体
         /// </summary>
         public RESULT_TAXI_MILEAGE GetModel(string strJCLSH)
         {
             string strSql = "";
             strSql += "select * from RESULT_TAXI_MILEAGE";
             strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

             DataTable dtTemp = new DataTable();
             DbHelper.GetTable(strSql, ref dtTemp);

             RESULT_TAXI_MILEAGE model = new RESULT_TAXI_MILEAGE();

             if(dtTemp.Rows.Count>0)
             {
                 model = new RESULT_TAXI_MILEAGE();

                 model.ID = dtTemp.Rows[0]["ID"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["ID"]);
                 model.LCBJCCS = dtTemp.Rows[0]["LCBJCCS"] == DBNull.Value ? "" : dtTemp.Rows[0]["LCBJCCS"].ToString();
                 model.JCLSH = dtTemp.Rows[0]["JCLSH"] == DBNull.Value ? "" : dtTemp.Rows[0]["JCLSH"].ToString();
                 model.LCB_PD = dtTemp.Rows[0]["LCB_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["LCB_PD"].ToString();
                 model.SCLC1 = dtTemp.Rows[0]["SCLC1"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCLC1"].ToString();
                 model.SCLC2 = dtTemp.Rows[0]["SCLC2"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCLC2"].ToString();
                 model.SCLC3 = dtTemp.Rows[0]["SCLC3"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCLC3"].ToString();
                 model.SCLC4 = dtTemp.Rows[0]["SCLC4"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCLC4"].ToString();
                 model.SCLC5 = dtTemp.Rows[0]["SCLC5"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCLC5"].ToString();
                 model.SCLC6 = dtTemp.Rows[0]["SCLC6"] == DBNull.Value ? "" : dtTemp.Rows[0]["SCLC6"].ToString();
                 model.MBLC1 = dtTemp.Rows[0]["MBLC1"] == DBNull.Value ? "" : dtTemp.Rows[0]["MBLC1"].ToString();
                 model.MBLC2 = dtTemp.Rows[0]["MBLC2"] == DBNull.Value ? "" : dtTemp.Rows[0]["MBLC2"].ToString();
                 model.MBLC3 = dtTemp.Rows[0]["MBLC3"] == DBNull.Value ? "" : dtTemp.Rows[0]["MBLC3"].ToString();
                 model.MBLC4 = dtTemp.Rows[0]["MBLC4"] == DBNull.Value ? "" : dtTemp.Rows[0]["MBLC4"].ToString();
                 model.MBLC5 = dtTemp.Rows[0]["MBLC5"] == DBNull.Value ? "" : dtTemp.Rows[0]["MBLC5"].ToString();
                 model.MBLC6 = dtTemp.Rows[0]["MBLC6"] == DBNull.Value ? "" : dtTemp.Rows[0]["MBLC6"].ToString();
                 model.JDWC1 = dtTemp.Rows[0]["JDWC1"] == DBNull.Value ? "" : dtTemp.Rows[0]["JDWC1"].ToString();
                 model.JDWC2 = dtTemp.Rows[0]["JDWC2"] == DBNull.Value ? "" : dtTemp.Rows[0]["JDWC2"].ToString();
                 model.JDWC3 = dtTemp.Rows[0]["JDWC3"] == DBNull.Value ? "" : dtTemp.Rows[0]["JDWC3"].ToString();
                 model.JDWC4 = dtTemp.Rows[0]["JDWC4"] == DBNull.Value ? "" : dtTemp.Rows[0]["JDWC4"].ToString();
                 model.JDWC5 = dtTemp.Rows[0]["JDWC5"] == DBNull.Value ? "" : dtTemp.Rows[0]["JDWC5"].ToString();
                 model.JDWC6 = dtTemp.Rows[0]["JDWC6"] == DBNull.Value ? "" : dtTemp.Rows[0]["JDWC6"].ToString();
                 model.XDWC1 = dtTemp.Rows[0]["XDWC1"] == DBNull.Value ? "" : dtTemp.Rows[0]["XDWC1"].ToString();
                 model.XDWC2 = dtTemp.Rows[0]["XDWC2"] == DBNull.Value ? "" : dtTemp.Rows[0]["XDWC2"].ToString();
                 model.XDWC3 = dtTemp.Rows[0]["XDWC3"] == DBNull.Value ? "" : dtTemp.Rows[0]["XDWC3"].ToString();
                 model.XDWC4 = dtTemp.Rows[0]["XDWC4"] == DBNull.Value ? "" : dtTemp.Rows[0]["XDWC4"].ToString();
                 model.XDWC5 = dtTemp.Rows[0]["XDWC5"] == DBNull.Value ? "" : dtTemp.Rows[0]["XDWC5"].ToString();
                 model.XDWC6 = dtTemp.Rows[0]["XDWC6"] == DBNull.Value ? "" : dtTemp.Rows[0]["XDWC6"].ToString();
                 model.LC1_PD = dtTemp.Rows[0]["LC1_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["LC1_PD"].ToString();
                 model.LC2_PD = dtTemp.Rows[0]["LC2_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["LC2_PD"].ToString();
                 model.LC3_PD = dtTemp.Rows[0]["LC3_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["LC3_PD"].ToString();
                 model.LC4_PD = dtTemp.Rows[0]["LC4_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["LC4_PD"].ToString();
                 model.LC5_PD = dtTemp.Rows[0]["LC5_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["LC5_PD"].ToString();
                 model.LC6_PD = dtTemp.Rows[0]["LC6_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["LC6_PD"].ToString();
                 model.TCDDZSJ = dtTemp.Rows[0]["TCDDZSJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["TCDDZSJ"].ToString();
                 model.TCDDJSSJ = dtTemp.Rows[0]["TCDDJSSJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["TCDDJSSJ"].ToString();
                 model.TCDDZSJBZ = dtTemp.Rows[0]["TCDDZSJBZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["TCDDZSJBZ"].ToString();
                 model.TCDDJSSJBZ = dtTemp.Rows[0]["TCDDJSSJBZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["TCDDJSSJBZ"].ToString();
                 model.TCDDZSJJDWC = dtTemp.Rows[0]["TCDDZSJJDWC"] == DBNull.Value ? "" : dtTemp.Rows[0]["TCDDZSJJDWC"].ToString();
                 model.TCDDJSSJJDWC = dtTemp.Rows[0]["TCDDJSSJJDWC"] == DBNull.Value ? "" : dtTemp.Rows[0]["TCDDJSSJJDWC"].ToString();
                 model.TCDDZSJXDWC = dtTemp.Rows[0]["TCDDZSJXDWC"] == DBNull.Value ? "" : dtTemp.Rows[0]["TCDDZSJXDWC"].ToString();
                 model.TCDDJSSJXDWC = dtTemp.Rows[0]["TCDDJSSJXDWC"] == DBNull.Value ? "" : dtTemp.Rows[0]["TCDDJSSJXDWC"].ToString();
                 model.TCDDZSJ_PD = dtTemp.Rows[0]["TCDDZSJ_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["TCDDZSJ_PD"].ToString();
                 model.TCDDJSSJ_PD = dtTemp.Rows[0]["TCDDJSSJ_PD"] == DBNull.Value ? "" : dtTemp.Rows[0]["TCDDJSSJ_PD"].ToString();
                 model.IsByHandle = dtTemp.Rows[0]["IsByHandle"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["IsByHandle"]);
             }

             dtTemp.Dispose();

             return model;
         }

         /// <summary>
         /// 得到一个对象实体
         /// </summary>
         public void GetModel(ref DataTable p_dtData, string strJCLSH)
         {
             p_dtData.Clear();

             string strSql = "";
             strSql += "select * from RESULT_TAXI_MILEAGE";
             strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

              DbHelper.GetTable(strSql, ref p_dtData);
         }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_TAXI_MILEAGE[] GetModelList(string p_strWhere, string p_strOrder, int p_intPageNumber, int p_intPageSize)
      {
          int m_intPageNumber = p_intPageNumber;
          int m_intPageCount = GetPageCount(p_strWhere, p_intPageSize);

          if((m_intPageNumber < 1) || (m_intPageNumber == 0))
          {
               m_intPageNumber = 1;
          }

          if(m_intPageNumber == -1)
          {
               m_intPageNumber = m_intPageCount;
          }

          if(m_intPageNumber > m_intPageCount)
          {
               m_intPageNumber = m_intPageCount;
          }

          string strSql = "";
          strSql += "select * from RESULT_TAXI_MILEAGE";
          if(p_strWhere.Trim().Length > 0)
          {
               strSql += " where " + p_strWhere;
          }
          if(p_strOrder.Trim().Length > 0)
          {
               strSql += " order by " + p_strOrder;
          }

          DataTable dtTemp = new DataTable();

          if(p_intPageSize > 0)
          {
               DbHelper.GetTable(strSql, ref dtTemp, (m_intPageNumber-1)*p_intPageSize, p_intPageSize);
          }
          else
          {
               DbHelper.GetTable(strSql, ref dtTemp);
          }

          RESULT_TAXI_MILEAGE[] arrModel=new RESULT_TAXI_MILEAGE[dtTemp.Rows.Count];

          for(int N=0;N<dtTemp.Rows.Count;N++)
          {
               arrModel[N] = new RESULT_TAXI_MILEAGE();

                 arrModel[N].ID = dtTemp.Rows[N]["ID"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["ID"]);
                 arrModel[N].LCBJCCS = dtTemp.Rows[N]["LCBJCCS"] == DBNull.Value ? "" : dtTemp.Rows[N]["LCBJCCS"].ToString();
                 arrModel[N].JCLSH = dtTemp.Rows[N]["JCLSH"] == DBNull.Value ? "" : dtTemp.Rows[N]["JCLSH"].ToString();
                 arrModel[N].LCB_PD = dtTemp.Rows[N]["LCB_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["LCB_PD"].ToString();
                 arrModel[N].SCLC1 = dtTemp.Rows[N]["SCLC1"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCLC1"].ToString();
                 arrModel[N].SCLC2 = dtTemp.Rows[N]["SCLC2"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCLC2"].ToString();
                 arrModel[N].SCLC3 = dtTemp.Rows[N]["SCLC3"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCLC3"].ToString();
                 arrModel[N].SCLC4 = dtTemp.Rows[N]["SCLC4"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCLC4"].ToString();
                 arrModel[N].SCLC5 = dtTemp.Rows[N]["SCLC5"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCLC5"].ToString();
                 arrModel[N].SCLC6 = dtTemp.Rows[N]["SCLC6"] == DBNull.Value ? "" : dtTemp.Rows[N]["SCLC6"].ToString();
                 arrModel[N].MBLC1 = dtTemp.Rows[N]["MBLC1"] == DBNull.Value ? "" : dtTemp.Rows[N]["MBLC1"].ToString();
                 arrModel[N].MBLC2 = dtTemp.Rows[N]["MBLC2"] == DBNull.Value ? "" : dtTemp.Rows[N]["MBLC2"].ToString();
                 arrModel[N].MBLC3 = dtTemp.Rows[N]["MBLC3"] == DBNull.Value ? "" : dtTemp.Rows[N]["MBLC3"].ToString();
                 arrModel[N].MBLC4 = dtTemp.Rows[N]["MBLC4"] == DBNull.Value ? "" : dtTemp.Rows[N]["MBLC4"].ToString();
                 arrModel[N].MBLC5 = dtTemp.Rows[N]["MBLC5"] == DBNull.Value ? "" : dtTemp.Rows[N]["MBLC5"].ToString();
                 arrModel[N].MBLC6 = dtTemp.Rows[N]["MBLC6"] == DBNull.Value ? "" : dtTemp.Rows[N]["MBLC6"].ToString();
                 arrModel[N].JDWC1 = dtTemp.Rows[N]["JDWC1"] == DBNull.Value ? "" : dtTemp.Rows[N]["JDWC1"].ToString();
                 arrModel[N].JDWC2 = dtTemp.Rows[N]["JDWC2"] == DBNull.Value ? "" : dtTemp.Rows[N]["JDWC2"].ToString();
                 arrModel[N].JDWC3 = dtTemp.Rows[N]["JDWC3"] == DBNull.Value ? "" : dtTemp.Rows[N]["JDWC3"].ToString();
                 arrModel[N].JDWC4 = dtTemp.Rows[N]["JDWC4"] == DBNull.Value ? "" : dtTemp.Rows[N]["JDWC4"].ToString();
                 arrModel[N].JDWC5 = dtTemp.Rows[N]["JDWC5"] == DBNull.Value ? "" : dtTemp.Rows[N]["JDWC5"].ToString();
                 arrModel[N].JDWC6 = dtTemp.Rows[N]["JDWC6"] == DBNull.Value ? "" : dtTemp.Rows[N]["JDWC6"].ToString();
                 arrModel[N].XDWC1 = dtTemp.Rows[N]["XDWC1"] == DBNull.Value ? "" : dtTemp.Rows[N]["XDWC1"].ToString();
                 arrModel[N].XDWC2 = dtTemp.Rows[N]["XDWC2"] == DBNull.Value ? "" : dtTemp.Rows[N]["XDWC2"].ToString();
                 arrModel[N].XDWC3 = dtTemp.Rows[N]["XDWC3"] == DBNull.Value ? "" : dtTemp.Rows[N]["XDWC3"].ToString();
                 arrModel[N].XDWC4 = dtTemp.Rows[N]["XDWC4"] == DBNull.Value ? "" : dtTemp.Rows[N]["XDWC4"].ToString();
                 arrModel[N].XDWC5 = dtTemp.Rows[N]["XDWC5"] == DBNull.Value ? "" : dtTemp.Rows[N]["XDWC5"].ToString();
                 arrModel[N].XDWC6 = dtTemp.Rows[N]["XDWC6"] == DBNull.Value ? "" : dtTemp.Rows[N]["XDWC6"].ToString();
                 arrModel[N].LC1_PD = dtTemp.Rows[N]["LC1_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["LC1_PD"].ToString();
                 arrModel[N].LC2_PD = dtTemp.Rows[N]["LC2_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["LC2_PD"].ToString();
                 arrModel[N].LC3_PD = dtTemp.Rows[N]["LC3_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["LC3_PD"].ToString();
                 arrModel[N].LC4_PD = dtTemp.Rows[N]["LC4_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["LC4_PD"].ToString();
                 arrModel[N].LC5_PD = dtTemp.Rows[N]["LC5_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["LC5_PD"].ToString();
                 arrModel[N].LC6_PD = dtTemp.Rows[N]["LC6_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["LC6_PD"].ToString();
                 arrModel[N].TCDDZSJ = dtTemp.Rows[N]["TCDDZSJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["TCDDZSJ"].ToString();
                 arrModel[N].TCDDJSSJ = dtTemp.Rows[N]["TCDDJSSJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["TCDDJSSJ"].ToString();
                 arrModel[N].TCDDZSJBZ = dtTemp.Rows[N]["TCDDZSJBZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["TCDDZSJBZ"].ToString();
                 arrModel[N].TCDDJSSJBZ = dtTemp.Rows[N]["TCDDJSSJBZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["TCDDJSSJBZ"].ToString();
                 arrModel[N].TCDDZSJJDWC = dtTemp.Rows[N]["TCDDZSJJDWC"] == DBNull.Value ? "" : dtTemp.Rows[N]["TCDDZSJJDWC"].ToString();
                 arrModel[N].TCDDJSSJJDWC = dtTemp.Rows[N]["TCDDJSSJJDWC"] == DBNull.Value ? "" : dtTemp.Rows[N]["TCDDJSSJJDWC"].ToString();
                 arrModel[N].TCDDZSJXDWC = dtTemp.Rows[N]["TCDDZSJXDWC"] == DBNull.Value ? "" : dtTemp.Rows[N]["TCDDZSJXDWC"].ToString();
                 arrModel[N].TCDDJSSJXDWC = dtTemp.Rows[N]["TCDDJSSJXDWC"] == DBNull.Value ? "" : dtTemp.Rows[N]["TCDDJSSJXDWC"].ToString();
                 arrModel[N].TCDDZSJ_PD = dtTemp.Rows[N]["TCDDZSJ_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["TCDDZSJ_PD"].ToString();
                 arrModel[N].TCDDJSSJ_PD = dtTemp.Rows[N]["TCDDJSSJ_PD"] == DBNull.Value ? "" : dtTemp.Rows[N]["TCDDJSSJ_PD"].ToString();
                 arrModel[N].IsByHandle = dtTemp.Rows[N]["IsByHandle"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["IsByHandle"]);
          }

          dtTemp.Dispose();

          return arrModel;
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_TAXI_MILEAGE[] GetModelList(string p_strWhere)
      {
          return GetModelList(p_strWhere, "", -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_TAXI_MILEAGE[] GetModelList(string p_strWhere, string p_strOrder)
      {
          return GetModelList(p_strWhere, p_strOrder, -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_TAXI_MILEAGE[] GetModelList(int p_intPageNumber, int p_intPageSize)
      {
          return GetModelList("", "", p_intPageNumber, p_intPageSize);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_TAXI_MILEAGE[] GetModelList(string p_strWhere, int p_intPageNumber, int p_intPageSize)
      {
          return GetModelList(p_strWhere, "", p_intPageNumber, p_intPageSize);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public RESULT_TAXI_MILEAGE[] GetModelList()
      {
          return GetModelList("", "", -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public void GetModelList(ref DataTable p_dtData, string p_strWhere, string p_strOrder, int p_intPageNumber, int p_intPageSize)
      {
          p_dtData.Clear();

          int m_intPageNumber = p_intPageNumber;
          int m_intPageCount = GetPageCount(p_strWhere, p_intPageSize);

          if((m_intPageNumber < 1) || (m_intPageNumber == 0))
          {
              m_intPageNumber = 1;
          }

          if(m_intPageNumber == -1)
          {
              m_intPageNumber = m_intPageCount;
          }

          if(m_intPageNumber > m_intPageCount)
          {
              m_intPageNumber = m_intPageCount;
          }

          string strSql = "";
          strSql += "select * from RESULT_TAXI_MILEAGE";
          if(p_strWhere.Trim().Length > 0)
          {
              strSql += " where " + p_strWhere;
          }
          if(p_strOrder.Trim().Length > 0)
          {
              strSql += " order by " + p_strOrder;
          }

          if(p_intPageSize > 0)
          {
              DbHelper.GetTable(strSql, ref p_dtData, (m_intPageNumber-1)*p_intPageSize, p_intPageSize);
          }
          else
          {
              DbHelper.GetTable(strSql, ref p_dtData);
          }
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere)
       {
           GetModelList(ref p_dtData, p_strWhere, "", -1, -1);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere, string p_strOrder)
       {
           GetModelList(ref p_dtData, p_strWhere, p_strOrder, -1, -1);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, int p_intPageNumber, int p_intPageSize)
       {
           GetModelList(ref p_dtData, "", "", p_intPageNumber, p_intPageSize);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere, int p_intPageNumber, int p_intPageSize)
       {
           GetModelList(ref p_dtData, p_strWhere, "", p_intPageNumber, p_intPageSize);
       }
       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData)
       {
           GetModelList(ref p_dtData, "", "", -1, -1);
       }
   }
}
